﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using LPV_POS.mh_pos;

namespace LPV_POS.Module
{
    public class Mod_khuyenmai_hanghoa_diem
    {
       DataTable tb;
        int ketqua = -1;
        public DataTable f_getdata_hanghoaban()
        {
            mh_khuyenmaihanghoa frm_khuyenmaihanghoa = new mh_khuyenmaihanghoa("Hàng hóa");
            
            frm_khuyenmaihanghoa.ShowDialog();
            if (frm_khuyenmaihanghoa.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                return frm_khuyenmaihanghoa.tbHH_KM;
            }
            return null;
        }
        public DataTable f_select_dvt()
        {
            tb = new thuvien().SP_SelectDataTable("sp_mh_dmkhuyenmaiquatang", new string[] { "@flag" }, new object[] { 4 });
            return tb;
        }

        public DataTable f_select_khuyenmaiquatang()
        {
            tb = new thuvien().SP_SelectDataTable("sp_mh_dmkhuyenmaiquatang", new string[] { "@flag" }, new object[] {1 });
            return tb;
        }
       
        public int f_insert_quatang(string tenquatang, string dvt)
        {
            ketqua = new thuvien().SP_Update("sp_mh_dmkhuyenmaiquatang", new string[] { "@flag", "@tenquatang", "@dvt" }, new object[] {2, tenquatang, dvt });
            return ketqua;
        }
        public int f_delete_quatang(int maquatang)
        {
            ketqua = new thuvien().SP_Update("sp_mh_dmkhuyenmaiquatang", new string[] { "@flag", "@maquatang" }, new object[] { 3, maquatang });
            return ketqua;
        }


    }
}
